Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

201
Visualizações
What is "this.return" in JavaScript?

While in VS Code, I hit the tab after typing return and the VS Code Intellisense auto-completed "return" to "this.return".

I've never seen this before and cannot find any documentation on it.

Does anybody know if this is actually a thing, or if VS Code possibly lost it's marbles.

Note: the object I was working in does not have any properties or functions called "return".

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Well, an object could have a property called return:

const obj = {
  return: () => { console.log('↩️'); }
};

obj.return();

Were you in the context of a class that had a return property, or maybe its superclass did?

(Honestly it seems more likely VS Code was just being weird.)

about 4 years ago · Juan Pablo Isaza Relatório

0

You can run console.log("this", this) in most modern browsers this will return the JSON data of this (the variable this refers to the current instance of declared object FYI), and console.log(typeof(this.return)) and it will likely return function (if you get undefined just change it from this.return to return;)

Likely the object either has a property called return that is a function, or something has gone wrong in the autocomplete.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda